<form w-i18n-ns="app.utils" novalidate name="setScript">

    <div class="body-2 margin-top-4 margin-05 " w-i18n="directives.scriptForm.textAreaTitle"></div>

    <w-input-container class="margin-2">
        <w-input ng-model="$ctrl.script"
                 ng-model-options="{updateOn: 'input blur', debounce: { 'input': 500, 'blur': 0 }}"
                 placeholder="directives.scriptForm.{{::$ctrl.placeHolderLiteral}}Placeholder"
                 w-i18n-attr="placeholder"
                 w-validate
                 w-validator-custom="{{$ctrl.isValid}}"
                 name="script"
                 textarea="true"
                 class="large"></w-input>

        <w-input-error ng-if="$ctrl.requiredError" message="custom">
            <span w-i18n="directives.scriptForm.errors.required"></span>
        </w-input-error>
        <w-input-error ng-if="$ctrl.validationError" message="custom">
            <span w-i18n="directives.scriptForm.errors.invalidScript"></span>
        </w-input-error>
    </w-input-container>

    <div class="plate-transparent margin-1 body-2">
        <span w-i18n="directives.scriptForm.ideLink"></span>
    </div>

    <div class="plate-warning margin-2">
        <div class="body-2 warning-500 margin-05" w-i18n="directives.scriptForm.warning.title"></div>
        <div class="footnote-1 basic-500" w-i18n="directives.scriptForm.warning.body"></div>
    </div>

    <div class="basic-500 footnote-1 margin-1"
         w-i18n="directives.scriptForm.fee"
         params="{fee: $ctrl.state.tx.fee}"></div>

    <div class="error-500"
         ng-if="!$ctrl.hasFee"
         params="{fee: $ctrl.state.tx.fee}"
         w-i18n="directives.scriptForm.errors.fee"></div>

    <w-sign-button class="big long submit margin-top-3"
                   disabled="setScript.$invalid || $ctrl.validationPending || !$ctrl.hasFee"
                   on-click="$ctrl.getSignable()"
                   on-success="$ctrl.next(signable)">
        <span w-i18n-ns="app.utils" w-i18n="directives.scriptForm.ok"></span>
    </w-sign-button>
</form>
